refactored article search function