Refactor to move responsibility of allocation undoing from the controller to the model