Reformat JS for best practices