Simplify recursion from X->Y->X to X->X