refactoring, unit-tests