refactor for server validations