navigation code cleanup