There are chunks of code in `dataset` and `loader` that can be moved into the `EdgeIndex` and `HyperedgeIndex` classes to improve reusability.