ordered items table refactoring