bug fix

Didn't update error path to match happy path.

Refactored for DRY

Refactored to remove unncessary parm passing