converting cart into single-item handler