made core rename logic more readable