makes several cleanups