refactor - simplified the client api