do a little more refactoring