refactor the test/set pattern in setting config values into a function
to make the code shorter

allow build to be unspecified

default to sample-config.xml