removed more cruft
added IDs and better rule grouping