improve the getCategories