Merge "Tidy up RulesManagerService code"