remove unused layers