Added a private function to process requests to both slave and master servers to reduce duplicate code.