improve merge to support deep merge, add areEmpty and areNotEmpty