make Classify function more dynamic