refactor config to use env vars