Factory method pattern practice