[imp] improve code