Improved GUI logic