refactor enum and castling