Implements tail-call package usage to avoid "RangeError: Maximum call stack size exceeded"