refactoring service to use config file instead of environment variables and flags