Added more TODOs, refracted code