refactoring complexity out of customvalidations