update for flat structure