Main UI change and some cleaning of code