refinement: simplify util code.