Some refactor to java 8