a few cleanups & utilities