Add passing of arguments to factory.

- add methods for passing of arguments
- modification of unit test