merge logic into task manager