Implement build(...) function.