Split out function for avoiding merges in Algorithm factory

Continues #485
Split out function for avoiding merges in Dialog factory

Closes #485