Replace (const-dynamically) the inner loop code