changed sources to make use of java 8 lambdas.