more cleanup/refactoring