Change processEntity to take std::shared_ptr to unify interface.