a little more refactoring...