task managment, refactory