re-org source code