MethodsFactory added and main function  finished.