Refactoring Tasks Controller