extract header switch statement