csv writer, output handler, similarity computation, refactoring