little more refactoring