1.x: Feature/factory rebase

Test for merging this PR into 1.x. This was originally for 2.x