Moved the unit row removal logic into an action.