Refactor deoanaylytics