Some minor function/unique_function optimizations