improve sorting in cachedecorator