Renamed internal functions
Added function updatePage() and let this be called by ajaxCompleted.