Tasks and projects code refactored