refactored to allow categories again