reorganize source and restructure bootstrap