Extracted methods from the MainWindow class to make maintaining
funtionality easier.