all optimizations are finished now we need some cleanups