add factory method design patterns.