DRY up JavaScript with mixins