Serial.read and Serial.parseint as an alternative to String and char manipulation?

Hello everyone It's been a while since the last time I coded in Arduino and this is my first post in this forum.
I have a problem with serial communication and strings that might be too easy to solve but I don't see the answer without making many complex "useless" steps.

My code is fair simple I am using serial communication to send information to my Arduino in the form of "xyyy" where x is a letter ,yyy can be numbers from 0 to 360.

When I started coding this project realized I could use an if statement like this if(Serial.read()=='y') followed by the function Serial.parseInt(). I could know what letter is y and also get the integer number inside the code. However today I found out that this method only works the first time an if case structure is read by the code.

void setup()
{
  Serial.begin(9600);
  }

void loop()
{
   if (Serial.available()>0)
   {

     if(Serial.read()=='a')
     { 
      int data = Serial.parseInt();
      Serial.print(data);
      Serial.print('\t');
     }

    else if(Serial.read()=='b'){
      int data = Serial.parseInt();
      Serial.print(data);
      Serial.print('\t');
     }
}
}

If you run the code as I mentioned it will detect x and yyy if the input starts with a, it will never enter in the if structure if the input starts with b. if swapped around it will only detect inputs starting with b and so on.

After doing some research I think the problem is that after failing the first if every next if when using Serial.read() will try to read the Serial port and hence clearing the original input.

It would make sense saving that information into a variable like a String: if that was the case then I wouldn't be able to use the technique I mentioned before the code. And then I would have to create a char string to get y and then convert the rest of the array to form xxx multiply the units to form a number of max 3 digits. Which in my opinion is too much of a hassle when I already found a workaround.

So is there a way to simplify what I am trying to do or I should stick with the overkill code just to split a string that contains numbers and letters?

Thanks in advance!