small refactoring to the rom loading code