Boil out some duplicated parser logic.