Method for stub merging