IMprove centralization of error handling

refs #13