Break setup() into setupLocalEnvironment() and setupGlobalEnvironment()