refinement: try simplify code.