refactoring worker.complete