some more basic refactoring