use factory methods for exceptions
Merge pull request #41 from ddeboer/simplify-exceptions

use factory methods for exceptions