Updating mixin to use better logic.