Refactoring + MainWindow improvements (UI added)