extracted and abstracted common code from drafts