Trying to extract common func from the build_* funcs.