refactoring of yandex metrica