refactor Moes to use CountEach
move histogram into T4 template