Factory pattern to master branch