Refactor to improve the way to get clicks and impressions count