Refacto Javascript notes