Use an extension function for initializing

This is still an implicit global ref. That was what the original self executing function was there for to prevent