new tests
minor refactoring