refactoring deadcell