Extracted doc creation from initialize method