Add builder pattern for creating dependencies

Is this meant to be called externally?