refactor alg project