small refactoring in castling move generation.