extracted all logic and persistence concerns from CartsController