Use inherit to replace switch