Adapt code to new layout