try to both simplify and fix detection of whether a job exists, taking into account possible duplication
update TODOs