GUI events improvements, code refactoring and style improvements