updated TODOs, cleaned up code