simplify parsing function