Update of the flatenning task and macros