moved some logic from the item view to the item model