Hmm.  If it requires that sort of modification I'd just keep this function.  Looks like you only call it once so it may not be needed anyway.