clean up and restructure