You might be able to use `abstract_type` to remove some of this.