Moved entity vector into the dispatcher and added cleanup and delete where needed