fine tune the structure of diagram