State to recursion impl