refactored classification framework