Refactor set alive dead cells