remove unused directives in files