Created factory with common validation functions and registered them on root scope in module's run method