removing unused layers