adds category pages
refactors category page code into one place