Improve factory.
Add validations.