Tidying up navigation JS