Refactor the job manager and remove thread inheritance