Refactoring: _ replaced with camelCase in Item class
Refactoring: extracted code
Removed one extra flush call