rewrote build process to be simplier and more generic