refactoring, first tests