move code to build.js per comments