Flatten hierarchy improvements