Pull the order by clause out