Reorganize and add rules