logic cleanups