move king and castling into king module