cleanup on the backend to move logic back to model where it should be