Clean up code in navigation