Refine code and add description.