I wonder if this chunk (from `len(indices) == 0`) should be a function/method since it's exactly the same as above... I'm not sure where good place for it would be though.