A bit of refactoring on the item repository