major changes and cleanups