simplify by making the build stuff a function