Improved the rename method.
Doesn't compile right now.