Refactoring delete and complete actions on pending tasks