minor code optimizations
performance tests