Refactoring actionWorker