refactor rules html