factory method app template refactor