remove redundance codes
refine performance