Hdf5 refactor