tidying up js before continuing enhancement