common.js: improve content loading