refactored to use config file instead of env vars