reordered code to highlight renderInitialView, attachLocationChangeListener and attachClickListener