Major refactor to have better support for the error messages
Test error message
Refactor validation
Minor corrections
Review and refactor