Divide cart controller class to make program more clear