Factored out code now that it's working into a unit testable class. Also fixed a bug with the rpm naming