Stop using global variables in navigation