Modified functions for categorization