Using $.extend replace mergeObjects function