Some tidying of the main nav code