Refactor the code to use yml configuration file