minor code optimizations