small modify, remove redundant codes