Refactored similarity measurer and model