Use factory instead of using new directly. Feedback:
Use factory instead of using new directly. Feedback:

https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6414#note_15765156

htve/GitlabForChinese,dreampet/gitlab,dplarson/gitlabhq,iiet/iiet-git,dreampet/gitlab,stoplightio/gitlabhq,stoplightio/gitlabhq,htve/GitlabForChinese,jirutka/gitlabhq,darkrasid/gitlabhq,shinexiao/gitlabhq,shinexiao/gitlabhq,dreampet/gitlab,stoplightio/gitlabhq,openwide-java/gitlabhq,allysonbarros/gitlabhq,allysonbarros/gitlabhq,daiyu/gitlab-zh,axilleas/gitlabhq,mmkassem/gitlabhq,darkrasid/gitlabhq,allysonbarros/gitlabhq,openwide-java/gitlabhq,screenpages/gitlabhq,dplarson/gitlabhq,htve/GitlabForChinese,dreampet/gitlab,darkrasid/gitlabhq,LUMC/gitlabhq,t-zuehlsdorff/gitlabhq,daiyu/gitlab-zh,axilleas/gitlabhq,screenpages/gitlabhq,allysonbarros/gitlabhq,icedwater/gitlabhq,mmkassem/gitlabhq,t-zuehlsdorff/gitlabhq,t-zuehlsdorff/gitlabhq,t-zuehlsdorff/gitlabhq,LUMC/gitlabhq,LUMC/gitlabhq,htve/GitlabForChinese,iiet/iiet-git,screenpages/gitlabhq,axilleas/gitlabhq,daiyu/gitlab-zh,openwide-java/gitlabhq,jirutka/gitlabhq,daiyu/gitlab-zh,LUMC/gitlabhq,screenpages/gitlabhq,stoplightio/gitlabhq,icedwater/gitlabhq,icedwater/gitlabhq,icedwater/gitlabhq,dplarson/gitlabhq,jirutka/gitlabhq,axilleas/gitlabhq,mmkassem/gitlabhq,openwide-java/gitlabhq,mmkassem/gitlabhq,jirutka/gitlabhq,iiet/iiet-git,dplarson/gitlabhq,darkrasid/gitlabhq,shinexiao/gitlabhq,shinexiao/gitlabhq,iiet/iiet-git