killing TODOs, and cleaned up error checking