Adapt to java 8