cleanup and routing