Refactored to validator object