Factory method pattern