refactoring tests, validation