Pull duplicate code out into mixin