migration to javascript