Cleanup and restructure