migrate to js