Refactor equality and loading of reference data