some optimizations suggested by PMD analysis results