271 analytics refactor