seperated category list logic from view