refactor Worker file