refinement of parsing to get types