relay: many more cleanups