template lib cleaning