Refactor client library.