Fixes analytics; needs optimization