Preparations for sorted results