refactoring: moving item-related functions to its own file