Move categorization functions to their own class.