Extract sort_offset method and preserve it first
Extract output_offset method and preserve it first
Extract sort_limit method
Extract output_limit method
Extract final_limit method