Refactor tasks view