refine CHspCode; some additions