refactoring, additional tests