Refactoring ActorRef usage