clean up the source and use guava optional