rewrite using lambdas
use lombok
add modernizer plugin
return charset instead of stirng
use java8 optional
fix modernizer warnings