Add necessary switch optimization