cleaning up analytics implementation