adapt code for next structure