factored out environment status to be a singleton
some clean-ups for injector handling