more junk removal
more refactoring