Refactors out external factories functionality