Remove module dependent exception handling.
Small refactoring.