There's a lot of duplicate code between `_subset_observations_hdf5`, `_subset_samples_hdf5`, and `_parse_hdf5`, and if we end up making changes to the file format, we'll have to update three methods. Can you please refactor to remove the duplicate code?