WIP rewrite of the build logic