refactoring articles functionality