refactoring items.c and items.h (incomplete)