Sometimes a recursive solution doesn't preserve any local fields during the recursive call, which makes Refactoring much easier. This is the case with, so called, tail recursions. Tail recursions are recursions where the recursive call is the last line in the method. Tail recursions are generally considered a bad practice and should be replaced with Iteration. This technique is well known to the people who work on compiler implementations.
Mechanics Determine the base case of the Recursion.
Base case, when reached, causes Recursion to end. Every Recursion must have a defined base case. Implement a loop that will iterate until the base case is reached. Make a progress towards the base case. Send the new arguments to the top of the loop instead to the recursive method.