Reorganize code.
Fixes.