small refactoring, testing