some java 8 optimizations