centralize environment validation