added notes on factory pattern