Refactor Script + Global and local GC state refactoring