further cleanup of extract_case_blocks