refined implementation of Task & TaskManager