Replace unless with if conditional on mask