improved separateJSFromHTMFile, improved log print logicl