Need help shrinking a code I'am new to Arduino and c++

i get his code from the INTERNET

void setup() {
    Serial.begin(57600);  
    pinMode(13, OUTPUT);
}
int f = 0, pos;
void loop() {
    boolean has_request = false;
    String in = "";
    if (Serial.available()) {
        in = "";
        while (true) {  // should add time out here
            while (Serial.available() == false) {}
            in += (char)(Serial.read());
            if (in.endsWith("\r\n\r\n")) {
                has_request = true;  break;
            } 
        }
    }
    if (has_request) {
        int i1 = in.indexOf("GET /blink?f="), i2;
        if (i1 != -1) {
            i2 = in.indexOf(" ", i1+13);
            f = in.substring(i1+13, i2).toInt();
        }
        Serial.println("HTTP/1.1 200 OK\nContent-Type: text/html\nConnection: close");
        String sr = "&lt;!DOCTYPE HTML&gt;\n";
        sr += "&lt;html&gt;\n";
        sr += "LED frequency: ";
        sr += f;
        sr += "Hz.&lt;/html&gt;";
        Serial.print("Content-Length: ");
        Serial.print(sr.length());
        Serial.print("\r\n\r\n");
        Serial.print(sr);
        has_request = false;
    }
    if (f&gt;0) {
        static unsigned long t = millis();
        if (millis() &gt; t + 1000/f) {
            digitalWrite(13, 1-digitalRead(13));
            t = millis();
        }
    }
}


see this link if you cant see the code formated here in the site

this code is used for the Arduino uno wifi shield
it is working perfectly except it is too complicated for me 
while loop inside a while loop 

and i don't want to do frequency i only need to send turn on or off
without any complexity 

anyone could help me ?
There is only one "while loop inside a while loop" and that is hardly complex:

while (Serial.available() == false) {}


All that means is "Wait for something to become available on the serial".  That is ALL it does.

There is nothing even remotely complex there.  True, it may not be very well written (as is the case with lots of code on t'interwebs).  It's time to start learning how the code works so you can write your own.