working SQL cleanups