clean up and restructuring