Move comparison functions to separate files