updated parser for better data structure