Factory pattern is implemented