Code reorganization.

Code reorganization.