Refactor merging and add AUTOLOAD for params