LPS-50696 autofill urlTitle and refactor Js code