refine jquery lib code