refactor client.set