Migrate builder to Kotlin