Refactored models to match the new backend