Finish sorting layout and routes