Merge two functions.