After several days searching why my code refactoring to remove globals was crashing,