fix #2562 extract code samples