restructured to share collab between scala and js