Factory method example