refactoring - move Worker function as parameter