Reorganized code.