Added javascript good practice