Implemented factory pattern. Merry Christmas!