DRY up error definitions
Refactor error specs