Move analytics to a separate file