Move inner exception factory classes. Refactor code. Add additional unit tests for exception factories.