cleaned up routing process