move soft delete check to separate function