cleanup performance optimization