Minor improvement to createItem method