Refactoring.
Refactoring.
Add error check.