Tailrec optimized preparation