Refactored js, removed jQuery dependancy and added google analytics