Simplifying header navigation logic