Restructured setup file and added upgrade function
Fixed failure style