Refactoring and adding time logging and file persistence for tasks