Refactor pawn movement logic