Some mall refactorings based on issues pointed out by IntelliJ.