code cleanup
limit results
Merge pull request #272 from Petercopter/271-analytics-refactor

271 analytics refactor