route cleanup and logging