[CLEANUP] Clean up the loops by inlining.