Use a constructor function for items
Remove some unused code