refactored createArticle function