Improve code.
Improve work with exceptions.