Refactor comment blocks and add additional line comments if needed
Simplify some lines in the add_rule function