Use mixin technique

I debated a bit whether it was worth doing this, but I couldn't see a reason not to, as it's backwards compatible.