added factory pattern, added sample factory + singleton, added tests