fix code structure