Code reorganized