There is no need to do recursion here. Look at how the legacy MVC does this.