more basic refactoring