Refactoring, added exception handlers.