Refactor Rules formatter