Switching RuleType to ARC. Minor code cleanup and improvements.