Refactored function for result-merging for greater clarity and conciseness