Refactored code some more. Handle multiple rules for a given flag.