refactoring with data file