simplify and cleanup the analytics library

#4