Any thoughts on tidying up the generic types in this code? They feel repetitive and heavy weight... I vaguely remember in Scala you can declare a generic type as a member of a type, which perhaps allows reducing the repetition, is there anything similar in Kotlin?