more refactoring / simplification