flatten block before parsing