added a boilerplate for factory pattern