removes unnecessary levels of encapsulation from the output of `mkopt`