cleanup js a bit & format text document