Optimize frame execution, cleanup code.