Refactor and fix some issues
Some rule reworking, hopefully simplify the rules a bit