Moved the client proxy code out into its own module