Further refine navbar JS