Java to Kotlin convertor: improving code related to primary constructors