a little refactoring of item and entity gen