extracted client into its own module