optimised waypoints navbar functions into 1 function