Refactor NavMenu.php

Change-Id: Iee3d3e179eea9825b0c262bb44582eab6ebb6323