refactor client with more options