Splitting out the actions into a map and actually building a grammar at the end