Rewrite the build system