Refactoring in progress. Commented out the existing update_rules() function and added methods to detect the removed rules