more refactoring, ping @samccone ...thoughts?