Reformat javascript