More refactoring for autoscaling GUI window.