better approach for validations