A mixin seems like the obvious choice. I'm not sure it's warranted in this particular case, though, given the tiny size of the duplicated code.