Large refactoring of Pawn