optimizations, guided by PMD.  hopefuly these don't affect anything, but existing unit tests still pass