Refactor recursion methods