Cleans and restructures