modularized test js code