Clean up window title code