alg:refactor