Use better Optional handling using Java 8 features.