improve analytics tracking, improve unit test