navbar code clean up