cleanups & optimizations