cleanup and restructuring