Clean up history handler