remove unnecessary directives