moved functionality to the build function