Removes unnecessary directives