cleaner refactor of shp parser