some additional refactoring