Refactored code and setup jaccard index method