Refactored gui system