Refactoring 

I refactored MainWindow class for a better overview and reading.
Please update names of functions where possible, thanks