dynamically choose data file
refactoring to handle different data