Implemented factory method pattern