restructure; clean up; unused code removal/commenting