new tests, refactoring