remove redundant variable
refine code