bugfix, simplify and expose rule parsing macro