Converted ChainedScope to Kotlin