Extracted navigation code to somewhere more useful