Examples of prototype and factory method