some refactoring and add GA and Yandex Metrika counters