refactor item attribute validation