Rewrote parserOfServerMessage function for clarity