Refactoring to remove Java 8.