A little more refactoring