Renaming iterations in loops and resource_id in res