Simplify GUI code