Lot of refactoring got some sketchiness out of my ruleset