cleanup.
reorder setup code.