reorganize code structrue