Refactor to Factory for instantiation