moved code around -- no real functional change