refactor the client & worker