Refactor of code in checkout_counter.rb and list_of_items.rb files.