refactoring to using config.yml and refactoring