Refactoring 

I refactored MainWindow class for a better overview and reading.
ok I can fix it