Removed dead code and upgraded to qt5