cleanup routing code