add function reorganization