Refactored the deep_merge code more