Added view logic to task view