Java to Kotlin converter: code refactoring