Improved Main/build system