Refactored TF_IDF class.