This is a good candidate to be turned into a macro and made private.