Changed analytics code due to redundancy