moved compare functions to domain objects