refactor the task stuff into partials and move the functionality to the right places