some more cleanups and started TODO