Simplify detection of global object