Optimized navbar and loaded relevant scripts on relevant pages