moved category display logic into view