refactor out item count