complete build rewrite