refact js file first
second
finished refact using js namespace
refactor js