analytics and removed some redundancy