Refactored gui