Streamlining and removing debug code