refactor. add client helper test and separate client js files.