well, it's not DRY, but it's also not a 300 line sub with goto (ok, redo) all over it