Migrating to scala