Improve abstract factory method