Refactored indexed types for easier conversion to internal data structures