Move logic to a mixin