refactoring a little.  some cleanup as well