Cleanup and restructuring