you can do a bit more checking maybe filter on creation function instead of .first() and there might some kotlin wrapper instead of dropping to ::class.java too but an exercise for another time. maybe enforce the create on the interface Createable too rather than just a marker interface.