move validation function to a Validation object