Lots of cleanup + stripping out unnecessary code