cleanup of obsolete sort code