refactoring, new tests