Consolidated the `load` code