factor output pasteboard related code