cleaned up history lookup.