Refactor GUI class.