simplify code of the last commit