Reorganized code
Reorganized code