Removing all unused directives from the solution