make rules a modal and cleanup HTML