misc. optimizations