Balancing in battery second life applications