Cleaned up some of the exception handling to use specific exceptions rather than just Exception