Refactoring to allow multiple endpoint types in StateViews