Refactored utils into a seperate file, cleaned up termFrequency