Refactoring inside the TdIdf class; Added term frequency function