adding singleton
adding factory pattern