eliminated some duplicate code in asset_loading