Refactoring compare page