Refactored models and types to have parameterized errors