analytics refacto for tabs