more refactoring
more cleanup