Added Factory Pattern(IntelliJIDEA)