Addressing #17 and adopting a better way to get a reference to the global object