refactoring validation tests for user