change the structure of pyframe