Refactoring of Google Analitics code