Refactoring some comparative analysis code
Addressed issue #32