DRYed up javascript