re-orgnize source code