reformatting js code