Small code changes for unit tests purposes.
Factory unit tests.