Reformatted code using JsFormat