adding factory-method pattern