fix code architecture