refactor: add type aliases for worker function