Separate build function.