Generalized KM theorems and their applications