Move the entity handling to a monitor which is correctly injected.