Added basic factory pattern