Factory design pattern added