simplify the codes of last commit