Simplified edit_item logic a bit.