Rewrite some unclear code.