generalize parser (and also spread it out)