need to refactor JS binding