minor optimizations and cleanups