refactoring for new fluxdata format