add if/else logic to upload url
factor out duplicate render calls
add if/else logic to spec
factor out duplicate render calls
factor out duplicate render calls