Js refactor- fixed formatting

Ugly indentation fixed