attempting some minor optimizations