extract some logic from views to controllers in cart process