split the client into a separate library