applied optimization that was proposed in https://github.com/akka/akka/pull/15596/files