moveed the merge_form logic to base helper