moved redundant code into mixin