updated parser logic