Split out function for avoiding merges in Dialog factory

Closes #485