review moved js code to seletate file