Move environment handling in config.