Moved category menu generation from view to model