avoid stack growth with recursive call.