Cleaned up categorizer logic