Reorg drawing code.