There are a few ways to do this, but none are really 'better' than this.
The alternatives would use a mixin, but that brings in the mental cost of black box abstraction for little gain. I'd just keep it as is.