make cartbox code more DRY
Merge branch 'fixg2_branch'