Beautify processRequest method