Update Analytics

Update Analytics to new code
Improvement code readability

Improvement code readability
Merge pull request #74 from jslegers/master

Update Analytics code