Convert `if` statements into guarded mixins