Extract the system tray setup code into a separate method.