simple parsing for rules

and a few other small things