Simplify gui code.