removing old unused code and resolving lots of little TODOs