Code reorganised