major refactor and cleanup
remove old crap