Refactors completing tasks to make tasks#update reusable