Split the desktop code to new files.