Implemented simple factory and singleton design patterns.
Merged