Refactor search way and add comparison_criteria methood. Start working on search by rms