refactor js

Change-Id: I4c3e3afc4e3682c784a3d322704ad642bfe6c0a7