Refactor callbacks to support Java 8 lambda expressions.