refactor the js struct.