refactor utils.merge, fixes #45