Notes on factory pattern.