Iterates over entities and does their logic