Refactoring to Jdk 1.8