#169 refactoring and junk removal