Hmm. But this code is used only here. I feel resistance in adding methods in classes of the standard library.