a bit cleaner GUI code