Task activity menu implemented. Some parts of the code refactored.