reorganize the build system