Adding implementation to switch generation.