Refactor the algorithm