finished cleanup and restructuring