reorder rules from top to bottom, separate classr from classlist
replace list and option rules by parametrized rules from the standard lib