improve analytics method