Refactoring of google analitics code