Added logic to rename package when it exists.
Reformatted some code around to make it better and easier to change version.