Remove unused stuff
basic refactoring and clean up