cleanup and upgrader fix