Optimized runtime for removing already used ids from prepared renamings