[UPDATE] reorganize code.