Refactor unblock task code