Refactor shared cart service.