converted a few anonymous classes to java 8 lambdas and fixed formatting.