move factory method up