Change linkage type from Internal to Private for internal functions and variables
Store globals to env instead of a global value