I don't like how this is a conditional inside the frgamnet. Please make a seperate frgament and do the swicth at controller level.