A little more refactoring and some comment cleanup