FIX common code for feat extraction