You should use two classes instead of the switch parameter. The logic to decide which variant to use will consequently have to be pushed up but there will be trouble like this.