Adapting some code to Akka 2.3.4 version