I currently have a function that does something similar to this (I wrote a minimal-working example for the sake of the discussion):
interface Variable { som