Replace inline document.ready with dispatcher