refactoring calls to get data based on config files