Switch-interpreter: Reduce amount of copy-pasted code. am: ee12e3abd3
am: f670be2788

Change-Id: I4c6c4304b14afc40a36deab7e3baa8d23c9fa113