Better final error handling

Using objects for passing error information and cleaning up code