Refactored entity daemon again.