Splitted JS logic from Init to Js namespace