Code strucuring changed