refactored code; default url gotten from yaml file