refine accoding to sunny's suggestion