some JSHint tidying