replace @Nullable with Optional<T>