Reorganize code
reorganize code