gui.py : Refactoring