Cleaned up privateBuild function