Move client into its own file