Abstract independent merging of components into a function