Extract interfaces for comparator and factory