factor preview and standalone out into separate codepaths