Pre-transform routes before passing to sorted so that sort key works