move the IP history agregation code into the library