abstract factory pattern implementation

Signed-off-by: armen mkrtchyan <armenmkrtchyan88@gmail.com>