Put makeEnv in seperate function