refactored cart app