Refactor client.