more cleanups and functionality