second
finished refact using js namespace