REFACTOR: Move the display of results out of document.ready