separate js code