remove repetitions of lines for directives in rules