Refactored move validation to use polymorphism.